\input{../newcommands}

Maxwell's equations in Fourier space are given by % --- Maxwell
\begin{subequations}
\begin{eqnarray}
\frac{\partial\fe}{\partial t} & = & c^2i\fk\times\fb-\frac{1}{\epsilon_0} \fj\\
\frac{\partial\fb}{\partial t} & = & -i\fk\times\fe\\
{}[i\fk\cdot\fe & = & \frac{\tilde{\rho}}{\epsilon_0}]\\
{}[i\fk\cdot\fb & = & 0]
\end{eqnarray}
\end{subequations}
where $\tilde{a}$ is the Fourier Transform of the quantity $a$.
As with the real space formulation, provided that the continuity equation
$\partial\tilde{\rho}/\partial t+i\fk\cdot\fj=0$ is satisfied, then
the last two equations will automatically be satisfied at any time
if satisfied initially and do not need to be explicitly integrated.

These equations can be integrated analytically over one timestep,
assuming that the current density $\fj$ is constant over this timestep, and that
the charge density is linear in time ($\tilde{\rho}(t) = \tilde{\rho}^n +
\frac{\tilde{\rho}^{n+1}-\tilde{\rho}^n}{\Delta t}(t-n\Delta t)$). This gives:
\begin{subequations}
\begin{eqnarray}
\fe^{n+1} & = & C\fe^{n}+\frac{S}{ck}\left(c^2i\fk\times\fb^{n}-\frac{1}{\epsilon_0}\fj^{n+1/2}\right) \\
 & - & i\fk\left[ \frac{1}{\epsilon_0 k^2}\left( 1 - \frac{S}{ck\Delta t} \right)\tilde{\rho}^{n+1}
 - \frac{1}{\epsilon_0 k^2}\left( C - \frac{S}{ck\Delta t} \right)\tilde{\rho}^{n}\right]\nonumber \\
\fb^{n+1} & = & C\fb^{n}-\frac{S}{ck}i\fk\times\fe^{n}\\
&+&\frac{1}{\epsilon_0}\frac{1-C}{c^2k^2}i\fk\times\fj^{n+1/2}.\label{Eq_PSATD_2}
\end{eqnarray}
\end{subequations}
with $C=\cos\left(c k\Delta t\right)$ and $S=\sin\left(c k\Delta t\right)$.

For fields generated by the source terms without the self-consistent
dynamics of the charged particles, this algorithm is free of numerical
dispersion and is not subject to a Courant condition. Furthermore,
this solution is exact for any time step size subject to the assumption
that the current source is constant over that time step.

As shown in \cite{VayJCP13}, by expanding the coefficients $S_{h}$
and $C_{h}$ in Taylor series and keeping the leading terms, the PSATD
formulation reduces to the perhaps better known pseudo-spectral time-domain
(PSTD) formulation \cite{DawsonRMP83,Liumotl1997}: % --- PSTD
\begin{subequations}
\begin{eqnarray}
\fe^{n+1} & = & \fe^{n}+ic^2\Delta t\fk\times\fb^{n+1/2}-\frac{\Delta t}{\epsilon_0}\fj^{n+1/2},\\
\fb^{n+3/2} & = & \fb^{n+1/2}-i\Delta t\fk\times\fe^{n+1}.
\end{eqnarray}
\end{subequations}
The dispersion relation of the PSTD solver is given by $\sin(\frac{\omega\Delta t}{2})=\frac{k\Delta t}{2}.$
In contrast to the PSATD solver, the PSTD solver is subject to numerical
dispersion for a finite time step and to a Courant condition that
is given by $\Delta t\leq \frac{2}{\pi}\left(\frac{1}{\Delta x^{2}}+\frac{1}{\Delta y^{2}}+\frac{1}{\Delta x^{2}}\right)^{-1/2}.$

The PSATD and PSTD formulations that were just given apply to the
field components located at the nodes of the grid. As noted in \cite{Ohmurapiers2010},
they can also be easily recast on a staggered Yee grid by multiplication
of the field components by the appropriate phase factors to shift
them from the collocated to the staggered locations. The choice between
a collocated and a staggered formulation is application-dependent.

Spectral solvers used to be very popular in the years 1970s to early 1990s, before being replaced by finite-difference methods with the advent of parallel supercomputers that favored local methods. However, it was shown recently that standard domain decomposition with Fast Fourier Transforms that are local to each subdomain could be used effectively with PIC spectral methods \cite{VayJCP13}, at the cost of truncation errors in the guard cells that could be neglected. A detailed analysis of the effectiveness of the method with exact evaluation of the magnitude of the effect of the truncation error is given in \cite{Vincenti2016a} for stencils of arbitrary order (up-to the infinite ``spectral'' order).
